package org.csu.petserver.web;

import org.csu.petserver.domain.Item;
import org.csu.petserver.service.ProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import java.util.List;

@Controller
@SessionAttributes("items")
public class Controller1 {

    @Autowired
    ProductInfo productInfo;
    @GetMapping("/hello")
    @ResponseBody
    public String hello(){
        return "hello...";
    }


    @GetMapping("/demo")
    String demo(Model model){
       // List<Item> items=productInfo.getAllItemByProductId("AV-CB-01");
       // model.addAttribute("items",items);
        return "demo";
    }
}
